<template>
  <div class="xch">
    <div class="header">
      <div class="header_top">
        <div class="phone">
          <img src="../assets/xch-img/电话.png" alt="" />
          <span>199-5069-1206</span>
        </div>
        <img class="phone_img" @click="$router.push('/')" src="../assets/xch-img/非遗美食.svg" alt="非遗美食" />
        <div class="shopping_cart">
          <a href="#" class="shopping_cart_right">
            <img src="../assets/xch-img/购物车.png" />
            <span>￥ 0.00</span>
          </a>
          &nbsp;
          <a :href="alink"><span v-html="datame"></span></a>
        </div>
      </div>
      <div class="header_nav">
        <div class="log">
          <img src="../assets/xch-img/logo300.png" />
        </div>
        <div class="navbar-collapse">
          <ul class="navbar-nav">
            <li>
              <router-link to="/Xch/home" exact>小超汇</router-link>
            </li>
            <li>
              <router-link to="/Xch/cxcy" exact>创新创业</router-link>
            </li>
            <li>
              <router-link to="/Xch/super" exact>区域小超</router-link>
            </li>
            <li>
              <router-link to="/Xch/type" exact>分类商品</router-link>
            </li>
            <li>
              <router-link to="/Xch/list" exact>商品列表</router-link>
            </li>
          </ul>
        </div>
        <div class="search">
          <input type="text" placeholder="输入商品信息" />
          <input style="width: 50px; height: 30px" type="submit" value="搜索" />
        </div>
      </div>
    </div>
    <div class="content">
      <router-view></router-view>
    </div>
    <XchFoot />
  </div>
</template>

<script>
import XchFoot from "../components/XchFoot.vue";
export default {
  data() {
    return {
      datame: '',
      alink: ''
    };
  },
  mounted() {
    if (localStorage.token) {
      this.datame = '我的'
      this.alink = '/meaning/home'
    } else {
      this.datame = '登录'
      this.alink = '/login'
    }
    ;
  },
  methods: {
  },
  components: { XchFoot },
};
</script>

<style lang="scss">
* {
  margin: 0;
  padding: 0;
}

.header {
  width: 100%;
  height: 152px;
  background-image: url(../assets/xch-img/header_bg.jpg);
  padding: 3em 0 0;
  background-size: 100% 100%;
  position: relative;
}

.content {
  width: 100%;
  background-image: url(../assets/xch-img/body_bg.jpg);
}

.foot {
  width: 100%;
  height: 164px;
  background-image: url(../assets/xch-img/footer_bg.png);
  padding: 3em 0 0;
  background-size: 100% 100%;
  position: relative;
}

.header_top {
  padding: 1em 0;
  position: absolute;
  top: -8px;
  display: flex;
}

.phone {
  padding-left: 150px;
}

.phone_img {
  cursor: pointer;
  width: 131px;
  padding-left: 210px;
}

.phone img {
  width: 20px;
  height: 25px;
  margin: 0 5px 0 0;
}

.phone span {
  color: white;
  font-size: 16px;
}

.shopping_cart {
  width: 100px;
  margin-left: 180px;
  display: flex;
  border-radius: 50px;
  background: linear-gradient(to bottom, #f49a86 0%, #e56346 50%, #d84828 100%);
}

.shopping_cart img {
  width: 15px;
  height: 15px;
  position: relative;
  top: 6px;
}

.shopping_cart span {
  color: white;
  font-size: 13px;
  position: relative;
  top: 3px;
}

.shopping_cart a {
  text-decoration: none;
}

.shopping_cart_right {
  border-right: 1px solid;
}

.header_nav .log img {
  width: 120px;
  padding-left: 150px;
  position: relative;
  top: 14px;
}

.navbar-collapse {
  position: relative;
  width: 650px;
  height: 36px;
  left: 400px;
  top: -75px;
  // background-color: pink;
}

.router-link-exact-active {
  background: rgba(2, 113, 113, 0.35) !important;
  // color: #fff !important;
  border-radius: 0.3em;
  box-shadow: inset 0 2px 0 rgb(0 0 0 / 20%), 0 0 4px rgb(0 0 0 / 10%);
}

.navbar-nav li {
  list-style: none;
  margin-left: 20px;
  display: block;
}

.navbar-collapse .navbar-nav {
  text-align: center;
  display: flex;
  line-height: 34px;
}

.navbar-nav a {
  text-decoration: none;
  font-size: 13px;
  color: white;
  margin: 0 10px;
  padding: 8px 15px;

  &:hover {
    background: rgba(2, 113, 113, 0.35) !important;
    border-radius: 0.3em;
    box-shadow: inset 0 2px 0 rgb(0 0 0 / 20%), 0 0 4px rgb(0 0 0 / 10%);
  }

  /* display: flex; */
}

.navbar-nav {
  padding-right: 15px;
  padding-left: 15px;
  margin-right: auto;
  margin-left: auto;
}

.search {
  width: 456px;
  height: 51px;
  margin: 0 auto;
  text-align: center;
  position: relative;
  background-image: url(../assets/xch-img/search.png);
  top: -59px;
}

.search input {
  width: 76%;
  height: 30px;
  padding: 4px 10px;
  margin-top: 10px;
  outline: none;
  border: 1px solid #cbc893;
  font-size: 0.85em;
  box-sizing: border-box;
  margin-right: 50px;
}

.search input[type="submit"] {
  padding: 5px 11px;
  outline: none;
  color: #901b02;
  border: 1px solid #e8360f;
  position: absolute;
  font-size: 0.8125em;
  box-sizing: border-box;
  text-shadow: -1px 0px 1px #eb5637;
  background: #ffd1c6;
  right: -5px;
  background: linear-gradient(to bottom, #ffd1c6 0%, #fe8d74 49%, #e8360f 100%);
}

.copy {
  padding: 5px 0px 10px 0px;
  text-align: center;
}

.copy span a {
  font-size: 12px;
  color: black;
  text-decoration: none;
}
</style>
